home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
ACORNUSERS
/
CBSA
/
EDUCATION
/
SAVER
/
cc
/
Test
next >
Wrap
Text File
|
1998-02-10
|
1KB
|
73 lines
//-----------------------------------
// Test.c
//-----------------------------------
#include <string.h>
#include <iostream.h>
#include "os.h"
#include "trap.h"
#include "WimpTask.h"
#include "WimpError.h"
#include "WimpIcon.h"
WimpIcon *b;
WimpIcon *c;
class MyTask : public WimpTask
{
public:
MyTask(char *);
bool ButtonPressed();
bool load(char *, int, int);
bool save(char *, int &);
};
MyTask::MyTask(char *name) : WimpTask(name)
{
EnableEvent(EBUT);
EnableEvent(EUSERDRAG);
}
bool MyTask::ButtonPressed()
{
if ((Mouse_Click.window == -2) && (Mouse_Click.icon == *b))
return(TRUE);
if ((Mouse_Click.window == -2) && (Mouse_Click.icon == *c))
{
c->drag();
return(FALSE);
}
return(FALSE);
}
bool MyTask::load(char *filename, int size, int type)
{
throw(filename);
return FALSE;
}
bool MyTask::save(char *filename, int &l)
{
throw(filename);
return FALSE;
}
int main()
{
MyTask a("CouCou");
b = new WimpIcon("my_sprite");
c = new WimpIcon("file_fff", WimpIcon::ISPRITE +
WimpIcon::IHCENTRE +
WimpIcon::IBTYPE*BDEBOUNCEDRAG); strcpy(a.FileName,"MonFichier");
c->drag(); // It's necessary,but I don't know why ?
a.run();
}